using System;
using System.Collections.Generic;
using System.Drawing;
using System.Drawing.Drawing2D;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Net5Dll
{
    public class UserTool
    {
        /// <summary>
        /// 获取全屏截图
        /// </summary>
        /// <returns></returns>
        public static Bitmap GetWindow(int width,int height)
        {
            Bitmap image = new Bitmap(width, height);
            Graphics imgGraphics = Graphics.FromImage(image);
            imgGraphics.CompositingQuality = CompositingQuality.HighQuality;
            //设置截屏区域
            imgGraphics.CopyFromScreen(0, 0, 0, 0, new Size(width, height));
            return image;
        }
    }
}
